package com.wangce.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wangce.bean.Dim;
import com.wangce.bean.Order;
import com.wangce.dao.OrderDao;
import com.wangce.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * ClassName: OrderServiceImpl
 * Description:
 * date: 2021/11/15 9:52
 *
 * @author 凡人
 * @since JDK 1.8
 */
@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    OrderDao orderDao;


    /**
     * 列表展示
     * @param d
     * @param cur
     * @param size
     * @return
     */
    @Override
    public PageInfo<Order> list(Dim d, Integer cur, Integer size) {
        PageHelper.startPage(cur,size);
        return new PageInfo<Order>(orderDao.list(d));
    }

    /**
     * 删除
     * @param id
     * @return
     */
    @Override
    public Integer delete(Integer[] id) {
        return orderDao.delete(id);
    }

    /**
     * 添加
     * @param order
     * @return
     */
    @Override
    public Integer add(Order order) {
        return orderDao.add(order);
    }
}
